function dateToString(now){
	var dateTime = "";
	if(now instanceof Date){
		var year = now.getFullYear();  
	    var month =(now.getMonth() + 1).toString();  
	    var day = (now.getDate()).toString();  
	    var hour = (now.getHours()).toString();  
	    var minute = (now.getMinutes()).toString();  
	    var second = (now.getSeconds()).toString();  
	    if (month.length == 1) {  
	        month = "0" + month;  
	    }  
	    if (day.length == 1) {  
	        day = "0" + day;  
	    }
	    dateTime = year + "-" + month + "-" + day; 
	}else{
		dateTime = now
	}
    return dateTime;  
}